/**
 * @version v1.0
 * @description:
 * @author: admin
 * @date: 2022/12/12 15:05
 * @copyright: 博为峰
 */
public class ArrayTest02 {
    public static void main(String[] args) {
        int[] arr = {20, 9, 15, 3, 26, 6, 11};

        //冒泡排序
        int t = 0;
        for (int i = 0; i < arr.length; i++) {//轮数
            for (int j = 0; j < arr.length - i - 1; j++) {//每一轮比较的次数
                 if(arr[j] > arr[j+1]){
                     t= arr[j];
                     arr[j] = arr[j+1];
                     arr[j+1] = t;
                 }
            }
        }

        for (int i = 0; i < arr.length; i++) {
            System.out.print(arr[i] + " ,");
        }
    }
}
